<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Validator;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        // 添加自定义验证规则
        // Validator::extend('规则名', function (属性, $value, 参数, 验证器) {
        //     return $value == 'foo';
        // });
        Validator::extend('qq', function ($attribute, $value, $parameters, $validator) {
            return $value > 10 ? true : false;
        });
    }
}
